*     *****************************************************************  * 
*     *****************************************************************  * 
*       File-Name:      fig5.2.do                                        *  
*       Date:           11 November 2016                                 * 
*       Author:         Golder (based on Blais and Gschwend)             * 
*       Purpose:      	create Figure 5.2                                *
* 	    Input Files:    chapter5.dta                                     *
*       Data Output:                                                     *              
*     ****************************************************************   * 
*     ****************************************************************   * 

version 14.2
clear
set more off

log using ch5_fig5_2.log, replace

**********************************************
* Specify your own local path to the dropbox *
**********************************************


use "C:\Users\sgolder\Dropbox\Projects\MEDW\ch5_turnout\New folder\ch5_replication_SG\chapter5.dta"


**** Construct graph

eststo M3: logit Voted Female Age Education Interest Europe Regional Attachment  Contact Impact Importance [pweight= DVWEIGHT] if REGIONID==301
estadd margins, dydx(*) 
*FIGURE 2
margin, at(Importance=(0(0.1)1)) 
marginsplot,  ylabel(0.2(0.1)0.8) recastci(rarea) recast(line) xtitle("Perceived Importance of Election", margin(medsmall)) ytitle("Pr (Turnout to Vote)", margin(medsmall)) title("")
graph export graph5_2.eps, replace

graph save Graph "C:\Users\sgolder\Dropbox\Projects\MEDW\ch5_turnout\New folder\ch5_replication_SG\Fig5_2.gph", replace


log close


exit



